Skip to content

feat: added scale up extra seat addon handling#7382

Open
Zaimwa9 wants to merge 5 commits intomainfrom
feat/enable-self-service-addition-of-seats
Open

feat: added scale up extra seat addon handling#7382
Zaimwa9 wants to merge 5 commits intomainfrom
feat/enable-self-service-addition-of-seats

Conversation

@Zaimwa9
Copy link
Copy Markdown
Contributor

@Zaimwa9 Zaimwa9 commented Apr 30, 2026

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Closes #121

  • Support Scale-Up-v4 Chargebee addon Additional-Team-Members-Scale-Up-v4 for auto-seat-upgrade
  • Refactor: Extract normalise_plan_id into SubscriptionPlanFamily to re-use plan_id normalisation
  • Move seat addon constants to chargebee/constants.py and add structured logging on successful seat addition

How did you test this code?

  • Added tests
  • Will need testing E2E on prod
  • Tested locally: extra seat worked, although locally I don't receive the webhook from chargebee hence why the total seats wasn't updated
image

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner April 30, 2026 13:53
@Zaimwa9 Zaimwa9 requested review from gagantrivedi and removed request for a team April 30, 2026 13:53
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 1, 2026 0:22am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ignored Ignored Preview May 1, 2026 0:22am
flagsmith-frontend-staging Ignored Ignored Preview May 1, 2026 0:22am

Request Review

@Zaimwa9 Zaimwa9 requested review from a team and khvn26 and removed request for gagantrivedi April 30, 2026 13:53
@github-actions github-actions Bot added api Issue related to the REST API feature New feature or request labels Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-7382 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-7382 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7382 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7382 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7382 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7382 Finished ✅ Results

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.44%. Comparing base (413c9b8) to head (392915a).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7382   +/-   ##
=======================================
  Coverage   98.44%   98.44%           
=======================================
  Files        1398     1398           
  Lines       52628    52646   +18     
=======================================
+ Hits        51808    51826   +18     
  Misses        820      820           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  11 passed

Details

stats  11 tests across 8 suites
duration  24.9 seconds
commit  b03098e
info  🔄 Run: #16469 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  11 passed

Details

stats  11 tests across 8 suites
duration  54 seconds
commit  05ec9d3
info  🔄 Run: #16470 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  11 passed

Details

stats  11 tests across 8 suites
duration  28.7 seconds
commit  05ec9d3
info  🔄 Run: #16470 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  11 passed

Details

stats  11 tests across 8 suites
duration  30 seconds
commit  b03098e
info  🔄 Run: #16469 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  50.9 seconds
commit  b03098e
info  🔄 Run: #16469 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 4 seconds
commit  b03098e
info  🔄 Run: #16469 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  11 passed

Details

stats  11 tests across 8 suites
duration  7.7 seconds
commit  928cdc3
info  🔄 Run: #16472 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  11 passed

Details

stats  11 tests across 8 suites
duration  29.9 seconds
commit  928cdc3
info  🔄 Run: #16472 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  53 seconds
commit  928cdc3
info  🔄 Run: #16472 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  4.7 seconds
commit  928cdc3
info  🔄 Run: #16472 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  11 passed

Details

stats  11 tests across 8 suites
duration  43.3 seconds
commit  392915a
info  🔄 Run: #16497 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  11 passed

Details

stats  11 tests across 8 suites
duration  23.4 seconds
commit  392915a
info  🔄 Run: #16497 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.9 seconds
commit  392915a
info  🔄 Run: #16497 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 7 seconds
commit  392915a
info  🔄 Run: #16497 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Visual Regression

16 screenshots compared. See report for details.
View full report

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner April 30, 2026 14:08
@github-actions github-actions Bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Apr 30, 2026
khvn26
khvn26 previously approved these changes May 1, 2026
Copy link
Copy Markdown
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with 2 non-blocking comments.

Comment on lines +240 to +242
audit_log.info(
"seat.added",
subscription__id=subscription_id,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add organisation__id here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thank you!!! I hesitated as it needs to update the callsite to pass it but i'm up for it!!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need it? I think we can grab organisation_id from the subscription cache object?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the caller, it's already available and avoids an extra DB call (even if it's not a frequent operation) and a circular import. Lmk
f0526a8

)

logger = logging.getLogger(__name__)
audit_log = structlog.get_logger("billing")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Let's not confuse with actual audit log — log is fine here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions github-actions Bot added docs Documentation updates and removed feature New feature or request docs Documentation updates labels May 1, 2026
@github-actions github-actions Bot added the feature New feature or request label May 1, 2026
@github-actions github-actions Bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants